import Util;
import RPC;
import EndpointUtil;

extends RPC;

init(config: RPC.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('cspro', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

model InvokeHistoryDataCheckRequest = {
  confType: string(name='ConfType'),
  checkTarget: string(name='CheckTarget'),
  checkType: string(name='CheckType'),
  historyStartTime: long(name='HistoryStartTime'),
  historyEndTime: long(name='HistoryEndTime'),
}

model InvokeHistoryDataCheckResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: long(name='Data'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function invokeHistoryDataCheckWithOptions(request: InvokeHistoryDataCheckRequest, runtime: Util.RuntimeOptions): InvokeHistoryDataCheckResponse {
  Util.validateModel(request);
  return doRequest('InvokeHistoryDataCheck', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function invokeHistoryDataCheck(request: InvokeHistoryDataCheckRequest): InvokeHistoryDataCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return invokeHistoryDataCheckWithOptions(request, runtime);
}

model AddFeedbackRequest = {
  resultId: long(name='ResultId'),
  feedBack: string(name='FeedBack'),
}

model AddFeedbackResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: long(name='Data'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function addFeedbackWithOptions(request: AddFeedbackRequest, runtime: Util.RuntimeOptions): AddFeedbackResponse {
  Util.validateModel(request);
  return doRequest('AddFeedback', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function addFeedback(request: AddFeedbackRequest): AddFeedbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFeedbackWithOptions(request, runtime);
}

model QuerySecCheckSampleLibsRequest = {
  type?: string(name='Type'),
  libId?: long(name='LibId'),
  currentPage: integer(name='CurrentPage'),
  pageSize: integer(name='PageSize'),
}

model QuerySecCheckSampleLibsResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    list: {
      omniSecCheckSampleLibDTO: [
        {
          id: long(name='Id'),
          type: string(name='Type'),
          name: string(name='Name'),
          extras: string(name='Extras'),
        }
      ](name='OmniSecCheckSampleLibDTO'),
    }(name='List'),
    pageInfo: {
      currentPage: integer(name='CurrentPage'),
      pageSize: integer(name='PageSize'),
      total: integer(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
}

async function querySecCheckSampleLibsWithOptions(request: QuerySecCheckSampleLibsRequest, runtime: Util.RuntimeOptions): QuerySecCheckSampleLibsResponse {
  Util.validateModel(request);
  return doRequest('QuerySecCheckSampleLibs', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function querySecCheckSampleLibs(request: QuerySecCheckSampleLibsRequest): QuerySecCheckSampleLibsResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecCheckSampleLibsWithOptions(request, runtime);
}

model InvokeOmniSecCheckImmediatelyRequest = {
  confType: string(name='ConfType'),
  checkTarget: string(name='CheckTarget'),
  checkType: string(name='CheckType'),
}

model InvokeOmniSecCheckImmediatelyResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: string(name='Data'),
}

async function invokeOmniSecCheckImmediatelyWithOptions(request: InvokeOmniSecCheckImmediatelyRequest, runtime: Util.RuntimeOptions): InvokeOmniSecCheckImmediatelyResponse {
  Util.validateModel(request);
  return doRequest('InvokeOmniSecCheckImmediately', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function invokeOmniSecCheckImmediately(request: InvokeOmniSecCheckImmediatelyRequest): InvokeOmniSecCheckImmediatelyResponse {
  var runtime = new Util.RuntimeOptions{};
  return invokeOmniSecCheckImmediatelyWithOptions(request, runtime);
}

model QuerySecCheckConfigsRequest = {
  confType: string(name='ConfType'),
  checkTarget?: string(name='CheckTarget'),
  currentPage: integer(name='CurrentPage'),
  pageSize: integer(name='PageSize'),
}

model QuerySecCheckConfigsResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    list: [
      {
        name: string(name='Name'),
        confType: string(name='ConfType'),
        checkTarget: string(name='CheckTarget'),
        extras: string(name='Extras'),
        valid: boolean(name='Valid'),
        accessible: boolean(name='Accessible'),
        id: long(name='Id'),
        spec: string(name='Spec'),
        checkDetailDTOList: [
          {
            checkType: string(name='CheckType'),
            checkIntervalUnit: string(name='CheckIntervalUnit'),
            checkIntervalVal: string(name='CheckIntervalVal'),
            checkExtras: string(name='CheckExtras'),
          }
        ](name='CheckDetailDTOList'),
      }
    ](name='List'),
    pageInfo: {
      currentPage: integer(name='CurrentPage'),
      pageSize: integer(name='PageSize'),
      total: integer(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
}

async function querySecCheckConfigsWithOptions(request: QuerySecCheckConfigsRequest, runtime: Util.RuntimeOptions): QuerySecCheckConfigsResponse {
  Util.validateModel(request);
  return doRequest('QuerySecCheckConfigs', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function querySecCheckConfigs(request: QuerySecCheckConfigsRequest): QuerySecCheckConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecCheckConfigsWithOptions(request, runtime);
}

model DelSecCheckSampleRequest = {
  libId: long(name='LibId'),
  type: string(name='Type'),
  sampleId: [ long ](name='SampleId'),
}

model DelSecCheckSampleResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function delSecCheckSampleWithOptions(request: DelSecCheckSampleRequest, runtime: Util.RuntimeOptions): DelSecCheckSampleResponse {
  Util.validateModel(request);
  return doRequest('DelSecCheckSample', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function delSecCheckSample(request: DelSecCheckSampleRequest): DelSecCheckSampleResponse {
  var runtime = new Util.RuntimeOptions{};
  return delSecCheckSampleWithOptions(request, runtime);
}

model AddSecCheckSampleRequest = {
  type: string(name='Type'),
  libId: long(name='LibId'),
  content: [ string ](name='Content'),
}

model AddSecCheckSampleResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function addSecCheckSampleWithOptions(request: AddSecCheckSampleRequest, runtime: Util.RuntimeOptions): AddSecCheckSampleResponse {
  Util.validateModel(request);
  return doRequest('AddSecCheckSample', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function addSecCheckSample(request: AddSecCheckSampleRequest): AddSecCheckSampleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSecCheckSampleWithOptions(request, runtime);
}

model AuthSecCheckSamplePicUploadRequest = {
}

model AuthSecCheckSamplePicUploadResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: string(name='Data'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function authSecCheckSamplePicUploadWithOptions(request: AuthSecCheckSamplePicUploadRequest, runtime: Util.RuntimeOptions): AuthSecCheckSamplePicUploadResponse {
  Util.validateModel(request);
  return doRequest('AuthSecCheckSamplePicUpload', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function authSecCheckSamplePicUpload(request: AuthSecCheckSamplePicUploadRequest): AuthSecCheckSamplePicUploadResponse {
  var runtime = new Util.RuntimeOptions{};
  return authSecCheckSamplePicUploadWithOptions(request, runtime);
}

model AddOmniSecCheckConfigRequest = {
  name: string(name='Name'),
  confType: string(name='ConfType'),
  checkTarget: string(name='CheckTarget'),
  checkDetailDTO: [
    {
      checkType?: string(name='CheckType'),
      checkIntervalUnit?: string(name='CheckIntervalUnit'),
      checkIntervalVal?: integer(name='CheckIntervalVal'),
      checkExtras?: string(name='CheckExtras'),
    }
  ](name='CheckDetailDTO'),
  extras?: map[string]any(name='Extras'),
  spec?: string(name='Spec'),
}

model AddOmniSecCheckConfigResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: long(name='Data'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function addOmniSecCheckConfigWithOptions(request: AddOmniSecCheckConfigRequest, runtime: Util.RuntimeOptions): AddOmniSecCheckConfigResponse {
  Util.validateModel(request);
  return doRequest('AddOmniSecCheckConfig', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function addOmniSecCheckConfig(request: AddOmniSecCheckConfigRequest): AddOmniSecCheckConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOmniSecCheckConfigWithOptions(request, runtime);
}

model AddSecCheckSampleLibRequest = {
  name: string(name='Name'),
  type: string(name='Type'),
}

model AddSecCheckSampleLibResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: long(name='Data'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function addSecCheckSampleLibWithOptions(request: AddSecCheckSampleLibRequest, runtime: Util.RuntimeOptions): AddSecCheckSampleLibResponse {
  Util.validateModel(request);
  return doRequest('AddSecCheckSampleLib', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function addSecCheckSampleLib(request: AddSecCheckSampleLibRequest): AddSecCheckSampleLibResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSecCheckSampleLibWithOptions(request, runtime);
}

model DelOmniSecCheckConfigRequest = {
  confId: long(name='ConfId'),
}

model DelOmniSecCheckConfigResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function delOmniSecCheckConfigWithOptions(request: DelOmniSecCheckConfigRequest, runtime: Util.RuntimeOptions): DelOmniSecCheckConfigResponse {
  Util.validateModel(request);
  return doRequest('DelOmniSecCheckConfig', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function delOmniSecCheckConfig(request: DelOmniSecCheckConfigRequest): DelOmniSecCheckConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return delOmniSecCheckConfigWithOptions(request, runtime);
}

model DelSecCheckSampleLibRequest = {
  libId: long(name='LibId'),
  type: string(name='Type'),
}

model DelSecCheckSampleLibResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function delSecCheckSampleLibWithOptions(request: DelSecCheckSampleLibRequest, runtime: Util.RuntimeOptions): DelSecCheckSampleLibResponse {
  Util.validateModel(request);
  return doRequest('DelSecCheckSampleLib', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function delSecCheckSampleLib(request: DelSecCheckSampleLibRequest): DelSecCheckSampleLibResponse {
  var runtime = new Util.RuntimeOptions{};
  return delSecCheckSampleLibWithOptions(request, runtime);
}

model GetSecCheckResultDetailRequest = {
  resultId: long(name='ResultId'),
  riskType?: string(name='RiskType'),
  riskSource: string(name='RiskSource'),
  currentPage: integer(name='CurrentPage'),
  pageSize: integer(name='PageSize'),
}

model GetSecCheckResultDetailResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    list: [
      {
        id: long(name='Id'),
        resultId: long(name='ResultId'),
        keywords: string(name='Keywords'),
        content: string(name='Content'),
        picUrl: string(name='PicUrl'),
        snapshotKey: string(name='SnapshotKey'),
        extra: string(name='Extra'),
        riskType: string(name='RiskType'),
      }
    ](name='List'),
    pageInfo: {
      currentPage: integer(name='CurrentPage'),
      pageSize: integer(name='PageSize'),
      total: integer(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
}

async function getSecCheckResultDetailWithOptions(request: GetSecCheckResultDetailRequest, runtime: Util.RuntimeOptions): GetSecCheckResultDetailResponse {
  Util.validateModel(request);
  return doRequest('GetSecCheckResultDetail', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function getSecCheckResultDetail(request: GetSecCheckResultDetailRequest): GetSecCheckResultDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSecCheckResultDetailWithOptions(request, runtime);
}

model GetSnapshotInfoRequest = {
  snapshotKey: string(name='SnapshotKey'),
}

model GetSnapshotInfoResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: string(name='Data'),
}

async function getSnapshotInfoWithOptions(request: GetSnapshotInfoRequest, runtime: Util.RuntimeOptions): GetSnapshotInfoResponse {
  Util.validateModel(request);
  return doRequest('GetSnapshotInfo', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function getSnapshotInfo(request: GetSnapshotInfoRequest): GetSnapshotInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSnapshotInfoWithOptions(request, runtime);
}

model QuerySecCheckLatestSummaryRequest = {
  confType: string(name='ConfType'),
  checkType?: string(name='CheckType'),
  currentPage: integer(name='CurrentPage'),
  pageSize: integer(name='PageSize'),
  checkTime?: string(name='CheckTime'),
}

model QuerySecCheckLatestSummaryResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    list: [
      {
        id: long(name='Id'),
        confType: string(name='ConfType'),
        checkType: string(name='CheckType'),
        checkTarget: string(name='CheckTarget'),
        urlCnt: long(name='UrlCnt'),
        riskCnt: long(name='RiskCnt'),
        checkTime: string(name='CheckTime'),
        gmtCheckStart: long(name='GmtCheckStart'),
        gmtCheckEnd: long(name='GmtCheckEnd'),
      }
    ](name='List'),
    pageInfo: {
      currentPage: integer(name='CurrentPage'),
      pageSize: integer(name='PageSize'),
      total: integer(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
}

async function querySecCheckLatestSummaryWithOptions(request: QuerySecCheckLatestSummaryRequest, runtime: Util.RuntimeOptions): QuerySecCheckLatestSummaryResponse {
  Util.validateModel(request);
  return doRequest('QuerySecCheckLatestSummary', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function querySecCheckLatestSummary(request: QuerySecCheckLatestSummaryRequest): QuerySecCheckLatestSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecCheckLatestSummaryWithOptions(request, runtime);
}

model QuerySecCheckResultRequest = {
  confType: string(name='ConfType'),
  checkType: string(name='CheckType'),
  currentPage: integer(name='CurrentPage'),
  pageSize: integer(name='PageSize'),
  checkTarget: string(name='CheckTarget'),
  startDate: long(name='StartDate'),
  endDate: long(name='EndDate'),
}

model QuerySecCheckResultResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    list: [
      {
        id: long(name='Id'),
        checkType: string(name='CheckType'),
        checkTarget: string(name='CheckTarget'),
        checkTime: string(name='CheckTime'),
        url: string(name='Url'),
        riskTypes: string(name='RiskTypes'),
        riskSources: string(name='RiskSources'),
        result: string(name='Result'),
      }
    ](name='List'),
    pageInfo: {
      currentPage: integer(name='CurrentPage'),
      pageSize: integer(name='PageSize'),
      total: integer(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
}

async function querySecCheckResultWithOptions(request: QuerySecCheckResultRequest, runtime: Util.RuntimeOptions): QuerySecCheckResultResponse {
  Util.validateModel(request);
  return doRequest('QuerySecCheckResult', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function querySecCheckResult(request: QuerySecCheckResultRequest): QuerySecCheckResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecCheckResultWithOptions(request, runtime);
}

model QuerySecCheckSamplesRequest = {
  libId: long(name='LibId'),
  type: string(name='Type'),
  currentPage: integer(name='CurrentPage'),
  pageSize: integer(name='PageSize'),
}

model QuerySecCheckSamplesResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    list: [
      {
        id: long(name='Id'),
        sample: string(name='Sample'),
        createTime: long(name='CreateTime'),
        extras: string(name='Extras'),
      }
    ](name='List'),
    pageInfo: {
      currentPage: integer(name='CurrentPage'),
      pageSize: integer(name='PageSize'),
      total: integer(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
}

async function querySecCheckSamplesWithOptions(request: QuerySecCheckSamplesRequest, runtime: Util.RuntimeOptions): QuerySecCheckSamplesResponse {
  Util.validateModel(request);
  return doRequest('QuerySecCheckSamples', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function querySecCheckSamples(request: QuerySecCheckSamplesRequest): QuerySecCheckSamplesResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecCheckSamplesWithOptions(request, runtime);
}

model UpdateOmniSecCheckConfigRequest = {
  name?: string(name='Name'),
  checkDetailDTO?: [
    {
      checkIntervalUnit?: string(name='CheckIntervalUnit'),
      checkIntervalVal?: integer(name='CheckIntervalVal'),
      checkExtras?: string(name='CheckExtras'),
      checkType?: string(name='CheckType'),
    }
  ](name='CheckDetailDTO'),
  extras?: map[string]any(name='Extras'),
  confId: long(name='ConfId'),
  valid?: boolean(name='Valid'),
  accessible?: boolean(name='Accessible'),
  spec?: string(name='Spec'),
}

model UpdateOmniSecCheckConfigResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function updateOmniSecCheckConfigWithOptions(request: UpdateOmniSecCheckConfigRequest, runtime: Util.RuntimeOptions): UpdateOmniSecCheckConfigResponse {
  Util.validateModel(request);
  return doRequest('UpdateOmniSecCheckConfig', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function updateOmniSecCheckConfig(request: UpdateOmniSecCheckConfigRequest): UpdateOmniSecCheckConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOmniSecCheckConfigWithOptions(request, runtime);
}

model QueryPunishOrderListRequest = {
  punishOrderListRequest: map[string]any(name='PunishOrderListRequest'),
}

model QueryPunishOrderListResponse = {
  requestId: string(name='RequestId'),
  code: integer(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
  data: string(name='Data'),
}

async function queryPunishOrderListWithOptions(request: QueryPunishOrderListRequest, runtime: Util.RuntimeOptions): QueryPunishOrderListResponse {
  Util.validateModel(request);
  return doRequest('QueryPunishOrderList', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function queryPunishOrderList(request: QueryPunishOrderListRequest): QueryPunishOrderListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPunishOrderListWithOptions(request, runtime);
}

model UploadOwnedDomainsRequest = {
  isOverWrite?: boolean(name='IsOverWrite'),
  domainList?: map[string]any(name='DomainList'),
}

model UploadOwnedDomainsResponse = {
  code: integer(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
  requestId: string(name='RequestId'),
}

async function uploadOwnedDomainsWithOptions(request: UploadOwnedDomainsRequest, runtime: Util.RuntimeOptions): UploadOwnedDomainsResponse {
  Util.validateModel(request);
  return doRequest('UploadOwnedDomains', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function uploadOwnedDomains(request: UploadOwnedDomainsRequest): UploadOwnedDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return uploadOwnedDomainsWithOptions(request, runtime);
}

model PostPunishOrderRequest = {
  punishOrderReq: map[string]any(name='PunishOrderReq'),
}

model PostPunishOrderResponse = {
  code: integer(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
  requestId: string(name='RequestId'),
}

async function postPunishOrderWithOptions(request: PostPunishOrderRequest, runtime: Util.RuntimeOptions): PostPunishOrderResponse {
  Util.validateModel(request);
  return doRequest('PostPunishOrder', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function postPunishOrder(request: PostPunishOrderRequest): PostPunishOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return postPunishOrderWithOptions(request, runtime);
}

model QueryPunishOrderRequest = {
  punishRequestId: string(name='PunishRequestId'),
}

model QueryPunishOrderResponse = {
  requestId: string(name='RequestId'),
  code: integer(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
  data: string(name='Data'),
}

async function queryPunishOrderWithOptions(request: QueryPunishOrderRequest, runtime: Util.RuntimeOptions): QueryPunishOrderResponse {
  Util.validateModel(request);
  return doRequest('QueryPunishOrder', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function queryPunishOrder(request: QueryPunishOrderRequest): QueryPunishOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPunishOrderWithOptions(request, runtime);
}

model RevokePunishOrderRequest = {
  punishRequestId: string(name='PunishRequestId'),
}

model RevokePunishOrderResponse = {
  requestId: string(name='RequestId'),
  code: integer(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
}

async function revokePunishOrderWithOptions(request: RevokePunishOrderRequest, runtime: Util.RuntimeOptions): RevokePunishOrderResponse {
  Util.validateModel(request);
  return doRequest('RevokePunishOrder', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function revokePunishOrder(request: RevokePunishOrderRequest): RevokePunishOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokePunishOrderWithOptions(request, runtime);
}

model GetIpProfileRequest = {
  ip: string(name='Ip'),
}

model GetIpProfileResponse = {
  requestId: string(name='RequestId'),
  code: string(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
  data: {
    ip: string(name='Ip'),
    info: {
      isAbroad: integer(name='IsAbroad'),
      isIdc: integer(name='IsIdc'),
      isProxy: integer(name='IsProxy'),
      isNat: integer(name='IsNat'),
      isBase: integer(name='IsBase'),
      isTor: integer(name='IsTor'),
      isBindDomain1d: integer(name='IsBindDomain1d'),
      isBindDomain7d: integer(name='IsBindDomain7d'),
      isBindDomain30d: integer(name='IsBindDomain30d'),
      isNetAttack1d: integer(name='IsNetAttack1d'),
      isNetAttack7d: integer(name='IsNetAttack7d'),
      isNetAttack30d: integer(name='IsNetAttack30d'),
      isBotnet1d: integer(name='IsBotnet1d'),
      isBotnet7d: integer(name='IsBotnet7d'),
      isBotnet30d: integer(name='IsBotnet30d'),
      isC21d: integer(name='IsC21d'),
      isC27d: integer(name='IsC27d'),
      isC230d: integer(name='IsC230d'),
      isBlackCampaign1d: integer(name='IsBlackCampaign1d'),
      isBlackCampaign7d: integer(name='IsBlackCampaign7d'),
      isBlackCampaign30d: integer(name='IsBlackCampaign30d'),
      isOpenCommonPort1d: integer(name='IsOpenCommonPort1d'),
      isOpenCommonPort7d: integer(name='IsOpenCommonPort7d'),
      isOpenCommonPort30d: integer(name='IsOpenCommonPort30d'),
      isCheatflow1d: integer(name='IsCheatflow1d'),
      isCheatflow7d: integer(name='IsCheatflow7d'),
      isCheatflow30d: integer(name='IsCheatflow30d'),
      isHijack1d: integer(name='IsHijack1d'),
      isHijack7d: integer(name='IsHijack7d'),
      isHijack30d: integer(name='IsHijack30d'),
      isProxy1d: integer(name='IsProxy1d'),
      isProxy7d: integer(name='IsProxy7d'),
      isProxy30d: integer(name='IsProxy30d'),
      country: string(name='Country'),
      province: string(name='Province'),
      city: string(name='City'),
      isp: string(name='Isp'),
      asnId: string(name='AsnId'),
    }(name='Info'),
  }(name='Data'),
}

async function getIpProfileWithOptions(request: GetIpProfileRequest, runtime: Util.RuntimeOptions): GetIpProfileResponse {
  Util.validateModel(request);
  return doRequest('GetIpProfile', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function getIpProfile(request: GetIpProfileRequest): GetIpProfileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIpProfileWithOptions(request, runtime);
}

model GetPhoneProfileRequest = {
  phone: string(name='Phone'),
}

model GetPhoneProfileResponse = {
  requestId: string(name='RequestId'),
  code: string(name='Code'),
  message: string(name='Message'),
  success: boolean(name='Success'),
  data: {
    phone: string(name='Phone'),
    info: {
      isVirtualOperator: integer(name='IsVirtualOperator'),
      isBlackPhone: integer(name='IsBlackPhone'),
      isBlackCampaign1d: integer(name='IsBlackCampaign1d'),
      isBlackCampaign7d: integer(name='IsBlackCampaign7d'),
      isBlackCampaign30d: integer(name='IsBlackCampaign30d'),
      province: string(name='Province'),
      city: string(name='City'),
      operator: string(name='Operator'),
    }(name='Info'),
  }(name='Data'),
}

async function getPhoneProfileWithOptions(request: GetPhoneProfileRequest, runtime: Util.RuntimeOptions): GetPhoneProfileResponse {
  Util.validateModel(request);
  return doRequest('GetPhoneProfile', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function getPhoneProfile(request: GetPhoneProfileRequest): GetPhoneProfileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPhoneProfileWithOptions(request, runtime);
}

model AddSiteCheckConfigRequest = {
  siteProtocol: string(name='SiteProtocol'),
  siteDomain: string(name='SiteDomain'),
  indexUrl: string(name='IndexUrl'),
  indexCheckFrequency: integer(name='IndexCheckFrequency'),
  siteCheckFrequency: integer(name='SiteCheckFrequency'),
  setBaseLine: boolean(name='SetBaseLine'),
}

model AddSiteCheckConfigResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: long(name='Data'),
  requestId: string(name='RequestId'),
}

async function addSiteCheckConfigWithOptions(request: AddSiteCheckConfigRequest, runtime: Util.RuntimeOptions): AddSiteCheckConfigResponse {
  Util.validateModel(request);
  return doRequest('AddSiteCheckConfig', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function addSiteCheckConfig(request: AddSiteCheckConfigRequest): AddSiteCheckConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSiteCheckConfigWithOptions(request, runtime);
}

model UpdateSiteCheckConfigRequest = {
  id: long(name='Id'),
  siteProtocol: string(name='SiteProtocol'),
  siteDomain: string(name='SiteDomain'),
  indexUrl: string(name='IndexUrl'),
  indexCheckFrequency: integer(name='IndexCheckFrequency'),
  siteCheckFrequency: integer(name='SiteCheckFrequency'),
  setBaseLine: boolean(name='SetBaseLine'),
}

model UpdateSiteCheckConfigResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
}

async function updateSiteCheckConfigWithOptions(request: UpdateSiteCheckConfigRequest, runtime: Util.RuntimeOptions): UpdateSiteCheckConfigResponse {
  Util.validateModel(request);
  return doRequest('UpdateSiteCheckConfig', 'HTTPS', 'POST', '2018-03-15', 'AK', null, request, runtime);
}

async function updateSiteCheckConfig(request: UpdateSiteCheckConfigRequest): UpdateSiteCheckConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSiteCheckConfigWithOptions(request, runtime);
}

model DelSiteCheckConfigRequest = {
  id: long(name='Id'),
}

model DelSiteCheckConfigResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
}

async function delSiteCheckConfigWithOptions(request: DelSiteCheckConfigRequest, runtime: Util.RuntimeOptions): DelSiteCheckConfigResponse {
  Util.validateModel(request);
  return doRequest('DelSiteCheckConfig', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function delSiteCheckConfig(request: DelSiteCheckConfigRequest): DelSiteCheckConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return delSiteCheckConfigWithOptions(request, runtime);
}

model QuerySiteCheckConfigsRequest = {
  siteDomain?: string(name='SiteDomain'),
  pageSize?: integer(name='PageSize'),
  page?: integer(name='Page'),
  checkId?: long(name='CheckId'),
}

model QuerySiteCheckConfigsResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: string(name='Data'),
  requestId: string(name='RequestId'),
}

async function querySiteCheckConfigsWithOptions(request: QuerySiteCheckConfigsRequest, runtime: Util.RuntimeOptions): QuerySiteCheckConfigsResponse {
  Util.validateModel(request);
  return doRequest('QuerySiteCheckConfigs', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function querySiteCheckConfigs(request: QuerySiteCheckConfigsRequest): QuerySiteCheckConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySiteCheckConfigsWithOptions(request, runtime);
}

model SetIndexBaselineRequest = {
  id: long(name='Id'),
}

model SetIndexBaselineResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
}

async function setIndexBaselineWithOptions(request: SetIndexBaselineRequest, runtime: Util.RuntimeOptions): SetIndexBaselineResponse {
  Util.validateModel(request);
  return doRequest('SetIndexBaseline', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function setIndexBaseline(request: SetIndexBaselineRequest): SetIndexBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return setIndexBaselineWithOptions(request, runtime);
}

model GetSiteCheckResultDetailRequest = {
  resultId: long(name='ResultId'),
  riskType: string(name='RiskType'),
  type: string(name='Type'),
}

model GetSiteCheckResultDetailResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  data: {
    resultId: long(name='ResultId'),
    keywords: string(name='Keywords'),
    content: string(name='Content'),
    urls: {
      urls: [ string ](name='Urls', description='Urls'),
    }(name='Urls'),
  }(name='Data'),
}

async function getSiteCheckResultDetailWithOptions(request: GetSiteCheckResultDetailRequest, runtime: Util.RuntimeOptions): GetSiteCheckResultDetailResponse {
  Util.validateModel(request);
  return doRequest('GetSiteCheckResultDetail', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function getSiteCheckResultDetail(request: GetSiteCheckResultDetailRequest): GetSiteCheckResultDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSiteCheckResultDetailWithOptions(request, runtime);
}

model QuerySiteCheckProgressRequest = {
  checkId: long(name='CheckId'),
  type: string(name='Type'),
  page?: integer(name='Page'),
  pageSize?: integer(name='PageSize'),
}

model QuerySiteCheckProgressResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: string(name='Data'),
  requestId: string(name='RequestId'),
}

async function querySiteCheckProgressWithOptions(request: QuerySiteCheckProgressRequest, runtime: Util.RuntimeOptions): QuerySiteCheckProgressResponse {
  Util.validateModel(request);
  return doRequest('QuerySiteCheckProgress', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function querySiteCheckProgress(request: QuerySiteCheckProgressRequest): QuerySiteCheckProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySiteCheckProgressWithOptions(request, runtime);
}

model QuerySiteCheckResultRequest = {
  siteDomain?: string(name='SiteDomain'),
  type?: string(name='Type'),
  page?: integer(name='Page'),
  pageSize?: integer(name='PageSize'),
  startDate?: long(name='StartDate'),
  endDate?: long(name='EndDate'),
}

model QuerySiteCheckResultResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: string(name='Data'),
  requestId: string(name='RequestId'),
}

async function querySiteCheckResultWithOptions(request: QuerySiteCheckResultRequest, runtime: Util.RuntimeOptions): QuerySiteCheckResultResponse {
  Util.validateModel(request);
  return doRequest('QuerySiteCheckResult', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function querySiteCheckResult(request: QuerySiteCheckResultRequest): QuerySiteCheckResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySiteCheckResultWithOptions(request, runtime);
}

model GetIndexBaselineRequest = {
  id: long(name='Id'),
}

model GetIndexBaselineResponse = {
  success: boolean(name='Success'),
  code: string(name='Code'),
  message: string(name='Message'),
  data: {
    baselinePic: string(name='BaselinePic'),
    baselineSource: string(name='BaselineSource'),
    checkId: long(name='CheckId'),
  }(name='Data'),
}

async function getIndexBaselineWithOptions(request: GetIndexBaselineRequest, runtime: Util.RuntimeOptions): GetIndexBaselineResponse {
  Util.validateModel(request);
  return doRequest('GetIndexBaseline', 'HTTPS', 'GET', '2018-03-15', 'AK', request, null, runtime);
}

async function getIndexBaseline(request: GetIndexBaselineRequest): GetIndexBaselineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIndexBaselineWithOptions(request, runtime);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
